<template>
  <el-main>
    <div class="user_title">用户信息</div>
    <div class="user_content">
      <el-row :gutter="20">
        <el-col :span="24">
          <p>登录名称: {{ userModel.username }}</p>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <p>用户名称: {{ userModel.name }}</p>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <p>电话: {{ userModel.phone }}</p>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <p>邮箱: {{ userModel.email }}</p>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <p>备注: {{ userModel.remark }}</p>
        </el-col>
      </el-row>
    </div>
  </el-main>
</template>
<script>
  import {getInfo} from "@/api/login/info";
  import {ApiError} from "@/utils/errors";

  export default {
    name: "save",
    data() {
      return {
        userModel: {}
      }
    },
    created() {
      this.getUserInfo();
    },
    methods: {
      getUserInfo() {
        getInfo().then(res => {
          if (res.status == 200) {
            if (!res.data.success) {
              return this.$message.error(ApiError.msg(res.data.message));
            }
            this.userModel = res.data.data;
          }
        });
      }
    }
  }
</script>

<style scoped>
  .user_title {
    padding-bottom: 20px;
    font-size: 16px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.85);
  }

  .user_content {
    padding-right: 16px;
  }
</style>

